<?php
/*
 *
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require ("DbConnector.php");
/**
 * Description of PortalDAO
 *
 * @author Administrator
 */
class PortalDAO {

    var $conn;
    function __construct() {

        $db = new DbConnector();
        $this->conn = $db->getConnection();

    }


    public function getForumsList(){

        
        $dbname = 'messageboardot_db';
        mysql_select_db($dbname) or die ("Could not select database");

        $sql_statement = "SELECT ID ,FORUM_NAME ,DESCRIPTION,CREATION_DATE FROM FORUMS";
        $result = mysql_query($sql_statement);



        $forums;
        $count = 0;

       while($row = mysql_fetch_array($result)) {
            $forum['ID'] = $row['ID'];
            $forum['FORUM_NAME'] = $row['FORUM_NAME'];
            $forum['DESCRIPTION'] = $row['DESCRIPTION'];
            $forum['CREATION_DATE'] = $row['CREATION_DATE'];
            $forums[$count] = $forum;
            $count++;
        }

        return $forums;

    }

   

}
?>
